// import React from 'react'
// import useScroll from './hooks/useScroll'
// export default function App() {
//   const {y}=useScroll()
//   return (
//     <div style={{height:'10000px'}}>
//       {y>900?<div style={{width:'50px',height:'100px',backgroundColor:'red',position:'fixed',top:'100px',right:'100px'}} onClick={()=>{
//         document.documentElement.scrollTop=0
//       }}>返回顶部</div>:<></>}
//     </div>
//   )
// }


import React from 'react'
import useRequest from './hooks/useRequest'
export default function App() {
  const [isLoading,data,error]=useRequest('https://www.fastmock.site/mock/aa707460627cc0c10a3e37f7925f6191/w06prj/getAllHouses')
  
  if(isLoading){
    return <div>.....数据正在加载中，请稍后</div>
  }
  if(data){
    console.log('data',data);
    return (
      <div></div>
    )
  }
  if(error){
    return (
      <div>网络有问题，请与管理员联系</div>
    )
  }
 
}

